import logging

f = open("./result/train.log", encoding='UTF-8', mode='a')
f.seek(0)
f.truncate()
logger = logging.getLogger("automated-train")
logger.setLevel(logging.DEBUG)

formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch = logging.StreamHandler(stream=f)
ch.setLevel(logging.DEBUG)
ch.setFormatter(formatter)
logger.addHandler(ch)

f1 = open('./result/test.log', encoding='UTF-8', mode='a')
test_logger = logging.getLogger("automated-test")
test_logger.setLevel(logging.DEBUG)

test_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
test_ch = logging.StreamHandler(stream=f1)
test_ch.setLevel(logging.DEBUG)
test_ch.setFormatter(test_formatter)
test_logger.addHandler(test_ch)
